package com.yys.apm.module.report.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yys.apm.module.report.entity.AppData;
import com.yys.apm.module.report.service.IReportService;
import com.yys.apm.module.report.vo.AppDataTreeVO;
import com.yys.apm.module.report.vo.AppDataVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 报表Controller类
 *
 * @author Yingsheng Ye
 * @date 2021-03-11 16:50
 */
@RestController
@RequestMapping("/report")
public class ReportController {

    @Resource
    private IReportService reportService;

    @RequestMapping("/queryAppDataList")
    public IPage<AppData> queryAppDataList(@RequestBody AppDataVO appDataVO) {
        return reportService.queryAppDataList(appDataVO);
    }

    @GetMapping("/queryAppDataDetails/{dataId}")
    public Map<String, Object> queryAppDataDetails(@PathVariable("dataId") Integer dataId) {
        return reportService.queryAppDataDetails(dataId);
    }

    @GetMapping("/queryAppDataByTraceId/{traceId}")
    public List<AppDataTreeVO> queryAppDataByTraceId(@PathVariable("traceId") String traceId) {
        return reportService.queryAppDataByTraceId(traceId);
    }

}
